function transect_bathymetry_filtered(ctr,All)

%Load and plot grid data
R=region_data_all(ctr);
fname=['../../generate_profiles/data/data_',R.name,'.mat']; load(fname,'C');

subplot('position',[0.05 0.1 0.85 0.9]); hold on;

tr=All.transect;
plt=find(tr(:,1)==ctr & tr(:,3)==1);

%Filter data
[Bf Af]=butter(4,interp1([0 1/2],[0 1],[1/200]),'high'); 
for ct=1:length(plt),
    zf=-All.z(plt(ct),:);
    zf=zf-nanmean(zf);
    zf(isnan(zf))=0;
    zf=filtfilt(Bf,Af,zf); 
    if ~exist('offset'); 
        offset=range(zf)/1.5;
    end;
    plot(All.time(3:end-2),zf(3:end-2)+offset*ct,'k','linewidth',1);
    text(0.01,offset*ct,[num2str(All.transect(plt(ct),2)),' West'],'fontsize',15,'linewidth',1);
end;
off=ct;
if isempty(off); off=0; end;

%plot
plt=find(tr(:,1)==ctr & tr(:,3)==2);
for ct=1:length(plt)
    zf=-All.z(plt(ct),:);
    zf=zf-nanmean(zf);
    zf(isnan(zf))=0;
    zf=filtfilt(Bf,Af,zf); 
    if ~exist('offset'); 
        offset=range(zf)/1.5;
    end;
    plot(All.time(3:end-2),zf(3:end-2)+offset*(ct+off),'k','linewidth',1);
    text(0.01,offset*(ct+off),[num2str(All.transect(plt(ct),2)),' East'],'fontsize',15,'linewidth',1);
end;
axis tight; h4=axis; 
axis off;

%name
axis([h4(1)-diff(h4(1:2))*0.1 h4(2:4)]); h4=axis;
plot([0 0],h4(3:4),'k--','linewidth',1);
%text(h4(1),h4(4)-0.05*diff(h4(3:4)),R.name,'fontsize',18); 
text(h4(1),h4(4)-0.05*diff(h4(3:4)),'filtered bathymetry','fontsize',18); 
axis off;

%unit bar
dx=diff(h4(1:2));
dy=diff(h4(3:4));
x=[1 1]*h4(1)+0.001*dx;
y=[h4(4)-0.1*dy h4(4)-0.1*dy-offset];
plot(x,y,'k','linewidth',1.5);
if dy>8*offset;
    label=round(linspace(0,offset,2));
end;
if dy<=8*offset & dy>4*offset;
    label=round(linspace(0,offset,3));
end;
if dy<=4*offset;
    label=round(linspace(0,offset,5));
end;

%transect label
for ct=1:length(label);
    plot([x(1) x(1)+0.005*dx],y(2)*[1 1]+label(ct),'k','linewidth',1.5);
    text(x(1)+0.01*dx,y(2)+label(ct),[num2str(label(ct)),' m'],'linewidth',1.5,'fontsize',12);
end;

%make x-axis
subplot('position',[0.05 0.098 0.85 0.001]); 
axis([h4(1:2) 0 1]);
font(gca,15);
h=xlabel('time (ka)'); font(h,15);



